package com.example.demo.controller;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

/**
 * @author krystal
 * @date 2023/3/8 15:40
 */
@ResponseBody
@Controller
public class CalcController {

    @RequestMapping("/calc")
    public String calc(Integer num1,Integer num2){
        if (num1==null || num2==null) return "参数错误";
        return "结果为=" +(num1+num2);
    }
}
